﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._23_访问者模式
{
    /// <summary>
    /// 普通产品
    /// </summary>
    public class RegularProduct : MyProduct
    {
        /// <summary>
        /// 产品名称
        /// </summary>
        public string Name { get; }
        /// <summary>
        /// 产品价格
        /// </summary>
        public decimal Price { get; }
        /// <summary>
        /// 产品数量
        /// </summary>
        public int Quantity { get; }

        public RegularProduct(string name, decimal price, int quantity)
        {
            Name = name;
            Price = price;
            Quantity = quantity;
        }
        /// <summary>
        /// 接受访问者
        /// </summary>
        /// <param name="visitor"></param>
        public void Accept(IVisitor visitor)
        {
            visitor.Visit(this);
        }

    }
}
